package sigmacinema.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="TB_Customer")
public class Customer {
    
    @Id
    @GeneratedValue
    @Column(name="id", length=10, nullable=false)
    private int custID;

    @Column(name="name", length=255, nullable=false)
    private String custName;

    @Column(name="birth_date", nullable=false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date custBirthDate;

    @Column(name="id_card", length=255)
    private String custIDCard;

    @Column(name="address", length=255, nullable=false)
    private String custAddress;

    @Column(name="city", length=255, nullable=false)
    private String custCity;

    @Column(name="province", length=255, nullable=false)
    private String custProv;

    @Column(name="post_code", length=255, nullable=false)
    private String custPostCd;

    @Column(name="phone", length=20, nullable=true)
    private String custPhone;

    @OneToOne
    @JoinColumn(name="email")
    private User user;

    public String getCustAddress() {
        return custAddress;
    }

    public void setCustAddress(String custAddress) {
        this.custAddress = custAddress;
    }

    public Date getCustBirthDate() {
        return custBirthDate;
    }

    public void setCustBirthDate(Date custBirthDate) {
        this.custBirthDate = custBirthDate;
    }

    public String getCustCity() {
        return custCity;
    }

    public void setCustCity(String custCity) {
        this.custCity = custCity;
    }

    public int getCustID() {
        return custID;
    }

    public void setCustID(int custID) {
        this.custID = custID;
    }

    public String getCustIDCard() {
        return custIDCard;
    }

    public void setCustIDCard(String custIDCard) {
        this.custIDCard = custIDCard;
    }

    public String getCustName() {
        return custName;
    }

    public void setCustName(String custName) {
        this.custName = custName;
    }

    public String getCustPhone() {
        return custPhone;
    }

    public void setCustPhone(String custPhone) {
        this.custPhone = custPhone;
    }

    public String getCustPostCd() {
        return custPostCd;
    }

    public void setCustPostCd(String custPostCd) {
        this.custPostCd = custPostCd;
    }

    public String getCustProv() {
        return custProv;
    }

    public void setCustProv(String custProv) {
        this.custProv = custProv;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
